﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Licenta1.Statements
{
    class ColorStatement:Statement
    {
        string color;

        public ColorStatement(Context con, string colour)
            : base(con)
        {
            color = colour;
        }

        public override void Execute()
        {
            //Console.WriteLine("Executed with color: " + color + " Current in rand: " + context.mp.rand.COLOR);
            switch (color)
            {
                case "red": { context.activeColor = Color.Red; context.activePen = new Pen(context.activeColor, context.activePen.Width); break; }
                case "yellow": { context.activeColor = Color.Yellow; context.activePen = new Pen(context.activeColor, context.activePen.Width); break; }
                case "orange": { context.activeColor = Color.Orange; context.activePen = new Pen(context.activeColor, context.activePen.Width); break; }
                case "blue": { context.activeColor = Color.Blue; context.activePen = new Pen(context.activeColor, context.activePen.Width); break; }
                case "purple": { context.activeColor = Color.Purple; context.activePen = new Pen(context.activeColor, context.activePen.Width); break; }
                case "green": { context.activeColor = Color.Green; context.activePen = new Pen(context.activeColor, context.activePen.Width); break; }
                case "white": { context.activeColor = Color.White; context.activePen = new Pen(context.activeColor, context.activePen.Width); break; }
                default: { context.activeColor = Color.Black; context.activePen = new Pen(context.activeColor, context.activePen.Width); break; }
            }
            //Console.WriteLine("Changed color: " + color + " Current in rand: " + context.mp.rand.COLOR);
        }

        public string COLOR
        {
            get { return color; }
        }
    }
}
